package com.wow.wa.util;

import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.List;

import com.wow.wa.bean.PareValue;

public class ProBeanUtilImpl implements ProBeanUtil {

	@Override
	public <T> List<PareValue> getPareValueByDomain(T obj) {
		final Field[] fs = obj.getClass().getDeclaredFields();
		final List<PareValue> pVs = new ArrayList<PareValue>();
		try {

			for (Field f : fs) {
				if (!Modifier.isStatic(f.getModifiers())) {
					final PareValue pV = new PareValue();
					pV.setKey(f.getName());
					pV.setValue((String) f.get(obj));
					pVs.add(pV);
				}

			}
		} catch (Exception e) {

		}
		// TODO Auto-generated method stub
		return pVs;
	}
}
